package com.spzx.test1.t2;
/*
    并非全力
*/

import java.sql.SQLOutput;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class test2 {
    public static void main(String[] args) throws ExecutionException, InterruptedException {

        FutureTask<Integer> task = new FutureTask<>(()->{
            System.out.println("FutureTask的call方法返回");
            return 100;
        });
        new Thread(task).start();
        Integer integer = task.get();
        System.out.println(Thread.currentThread().getName()+ "FutureTask返回的结果"+integer);

    }
}
